# -*- coding=utf-8-*-
"""
@File:memory_selection
@Author:Created by Han X.Y
@Date:on 2021/7/15 19:43 
"""
#参考代码，如嫌啰嗦，建议删除，一行搞定
def solve_it(w,n):
    '''
    pythontip oj不同于传统oj，代码里面直接使用变量，无需要提前声明，免去复杂的输入解析
    life is short, so i user python~
    you can use variables w , n
    '''
    n=len(w)
    sorted_w=sorted(w,reverse=True)
    while n>0:
        for i in sorted_w:
            if n>i:
                tmp_n=n//i
                n-=tmp_n*i
    return "Yes" if n==0 else "No"
if __name__=='__main__':
    w=[1,2]
    n=18
    print(solve_it(w,n))  # 答案需要输出
